package com.feicheng.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.feicheng.entity.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hao.zhang
 * @since 2022-07-04
 */
@Repository
@Mapper
public interface ProductMapper extends BaseMapper<Product> {

    /**
     * 通过产品名字和类型查询产品id
     * @author zhennan.liu
     * @param type
     * @param name
     * @return
     */
    @Select("select product_id from product where type = #{type} and product_name = #{productName} ")
    Integer selectByTypeName(@Param("type") String type,
                             @Param("productName") String name);
}
